<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/base/base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<!-- <title>userList</title> -->
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
	<meta name="author" content="Muhammad Usman">
	<script type="text/javascript">
		
	function addUser(path){
// 		alert(path);
		window.location.href = path+'/userController/inputAddUser.do';
	}
	function deleteUserById(path,id){
		if(confirm("是否将此条信息删除?")){
			window.location.href = path+'/userController/deleteUserById.do?id='+id;
			return true; 
		} else{
			return false;
		} 
	}
	</script>
</head>
<body>
	<div id="content" class="span11">
			<!-- content starts -->
			<div  class="row-fluid sortable">		
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-th-list"></i>&nbsp;管理员列表</h2>
							<div class="box-icon">
							  <button class="btn btn-large btn-primary btn-round" onclick="addUser('<%=path%>');"> 
							  	<span class="icon icon-darkgray icon-plus" title=".icon  .icon-darkgray  .icon-plus "></span>
							  	&nbsp;添 &nbsp;加 &nbsp;&nbsp;</button>
							</div>
<!-- 						<div class="box-icon"> -->
<!-- 							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a> -->
<!-- 							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a> -->
<!-- 							<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a> -->
<!-- 						</div> -->
					</div>
					<div class="box-content">
						<table class="table table-striped table-bordered bootstrap-datatable datatable">
						  <thead>
							  <tr>
							  	  <th>序号</th>
							  	  <th>CODE号</th>
								  <th>姓名</th>
								  <th>密码</th>
								  <th>角色</th>
								  <th>状态</th>
								  <th>操作</th>
							  </tr>
						  </thead>   
						  <tbody>
						  <c:forEach items="${userList }" var="user" varStatus="status">
								<tr>
									<td align="center">${status.count }</td>
									<td>${user.code }</td>
									<td>${user.name }</td>
									<td class="center">${user.pwd }</td>
									<td class="center">Member</td>
									<td class="center">
										<span class="label label-success">Active</span>
									</td>
									<td class="center">
										<a class="btn btn-success" href="#">
											<i class="icon-zoom-in icon-white"></i>  
											明细                                            
										</a>
										<a class="btn btn-info" href="<%=path%>/userController/inputUpdateUser.do?id=${user.id }">
											<i class="icon-edit icon-white"></i>  
											修改                                            
										</a>
										<a class="btn btn-danger" href="javascript:void(0)" onclick="deleteUserById('<%=path%>',${user.id });">
											<i class="icon-trash icon-white"></i> 
											删除
										</a>
									</td>
								</tr>
							</c:forEach>
						  </tbody>
					  </table>            
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
	</div>
</body>
</html>